#include <lib.h>
#define dfs_set_neighbours_address _dfs_set_neighbours_address
#include <dfs.h>
#include <string.h>

#if _ANSI
PUBLIC int dfs_set_neighbours_address(const char *ip,int sd)
#else
PUBLIC int dfs_set_neighbours_address(ip,sd)
const char *ip
int sd
#endif
{
	int reply,len;
	message m;		
	/* checking address len */
	len = strlen(ip);
	if (len > MAXIPADDRESSLEN || len < MINIPADDRESSLEN) return(ERROR);
	
	/* Set message to be sent */
	m.IPADDRESS= (char *)ip;
	m.IPADDRESSLEN = len; /* Consider that this len might be stable . Standard IPv4 addressing is strlen("xxx.xxx.xxx.xxx" ) = 15 */ 
	m.SD = sd;
	
	/* Making the call */
	reply = _syscall(DFS,DFS_SET_NEIGHBOUR_ADDRESS,&m);
	
	/* Return results */
	return reply;
}
